﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>无标题文档</title>
		<meta http-equiv="content-Type" content="text/html;charset=gb2312">
		<script src="../js/DateJS.js" type="text/javascript">
		</script>
	</head>
	<style type="text/css">
		body {
			background-color: #3994EE;
			text-align: center;
		}
		
		.div1 {
			background-image: url(img/1.png);
			width: 118px;
			height: 60px;
			color: #F6F6F6;
			float: left;
		}
		
		.div1:hover {
			background-image: url(img/2.png);
		}
		
		.div1:active {
			background-image: url(img/3.png);
		}
		
		a {
			text-decoration: none;
		}
		
		.div2 {
			height: 1px;
		}
		
		.div3 {
			border: #0CF solid 2px;
			height: 600px;
			margin-top: 65px;
			background-color: #E7FEED;
		}
		
		.table {
			margin: auto;
		}
		
		.input1 {
			background-color: #EEA6AD;
		}
	</style>

	<body>
		<div id="StaffStation">
			<div class="div2">
				<table width="354px" height="60px" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="118">
							<a href="ygyd1.html">
								<div class="div1">
									<h4 style="text-align:center; line-height:0"> 员工部门调动</h4>
								</div>
							</a>
						</td>
						<td width="118">
							<a href="ygyd2.html">
								<div class="div1" style=" background-color:#F90">
									<h4 style="text-align:center; line-height:0"> 员工岗位调动</h4>
								</div>
							</a>
						</td>
						<td width="118">
							<a href="ygyd3.html">
								<div>

								</div>
							</a>
						</td>
					</tr>
				</table>
			</div>
			<div class="div3">
				<h1>员工岗位调动信息填写</h1>
				<div align="center">
					<form onsubmit="return false">
						<table width="554px" height="270px" class="table" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="122" rowspan="9">&nbsp;

								</td>
								<td width="120" height="30" align="right">
									员工编号：
								</td>
								<td width="190" align="left">
									<input v-model="id" type="number" @blur.bative.capture='selectById()'>
									<font color="#FF0000">*</font>
								</td>
								<td width="122">
									<font color="#FF0000" size="-1">注意：" * "为必填项--输入员工号后可自动生成姓名与岗位</font>
								</td>
							</tr>
							<tr>
								<td height="30" align="right">
									员工姓名：
								</td>
								<td align="left">
									<input v-model="username" disabled="disabled" />
									<font color="#FF0000">*</font>
								</td>
								<td>&nbsp;

								</td>
							</tr>
							<tr>
								<td height="30" align="right">
									调转前岗位：
								</td>
								<td align="left">
									<select v-model="station" disabled="disabled">

										<option value="营销推广">营销推广</option>

										<option value="销售代理">销售代理</option>

										<option value="采购材料">采购材料</option>

										<option value="市场调查">市场调查</option>

										<option value="创意总监">创意总监</option>

										<option value="设计员">设计员</option>

										<option value="检测员">检测员</option>

										<option value="人事经理">人事经理</option>

										<option value="后勤员">后勤员</option>

										<option value="总经理">总经理</option>

										<option value="副总经理">副总经理</option>

										<option value="经理助理">经理助理</option>

									</select>
									<font color="#FF0000">*</font>
								</td>
								<td>&nbsp;

								</td>
							</tr>
							<tr>
								<td height="30" align="right">
									调转后岗位：
								</td>
								<td align="left">
									<select v-model="newsta">

										<option value="营销推广">营销推广</option>

										<option value="销售代理">销售代理</option>

										<option value="采购材料">采购材料</option>

										<option value="市场调查">市场调查</option>

										<option value="创意总监">创意总监</option>

										<option value="设计员">设计员</option>

										<option value="检测员">检测员</option>

										<option value="人事经理">人事经理</option>

										<option value="后勤员">后勤员</option>

										<option value="总经理">总经理</option>

										<option value="副总经理">副总经理</option>

										<option value="经理助理">经理助理</option>

									</select>
									<font color="#FF0000">*</font>
								</td>
								<td>&nbsp;

								</td>
							</tr>
							<tr>
								<td height="30" align="right">
									调转类型：
								</td>
								<td align="left">
									<select v-model="type">
										<option value="升职">
											升职
										</option>
										<option value="降职">
											降职
										</option>
										<option value="数据录入错误">
											数据录入错误
										</option>
									</select>
									<font color="#FF0000">*</font>
								</td>
								<td>&nbsp;

								</td>
							</tr>
							<tr>
								<td height="30" align="right">
									调转原因：
								</td>
								<td align="left">
									<input v-model="reason" type="text" />
									<font color="#FF0000"></font>
								</td>
								<td>&nbsp;

								</td>
							</tr>
							<tr>
								<td height="30" align="right">
									备注：
								</td>
								<td align="left">
									<input v-model="remarks" type="text" />
								</td>
								<td>&nbsp;

								</td>
							</tr>
							<tr>
								<td height="30" align="right">
									调动日期：
								</td>
								<td align="left">
									<input type="date" v-model="transfer_date" />
									<font color="#FF0000">*</font>
								</td>
								<td>&nbsp;

								</td>
							</tr>
							<tr>
								<td height="30">
									<a href="ygxxcx.html">员工列表查询</a>
								</td>
								<td align="left">
									<input type="button" @click="updateStaffStation()" value="提交" />
									<input type="reset" value="重置" />
								</td>
								<td>&nbsp;

								</td>
							</tr>
						</table>
					</form>
					<h3 style="color:red;"></h3>
				</div>

			</div>
		</div>
		
		<script src="../js/vue.js"></script>
		<script src="../js/axios.js"></script>
		<script>
			axios.defaults.baseURL = "http://176.55.4.113"
			const StaffStation = new Vue({
				el: "#StaffStation",
				data: {
					id: '',
					username: '',
					station: '营销推广',
					newsta: '营销推广',
					type: '升职',
					reason: '',
					remarks: '',
					transfer_date: ''
				},
				methods: {
					selectById(){
						axios.get("/staff_status/queryByStaffId?id="+this.id)
						.then(result =>{
							this.username = result.data.data.user_name,
							this.station = result.data.data.station					 
						})
					},
					updateStaffStation(){
						axios.put("/staff_status/station",{
							id: this.id,
							after_sta: this.newsta,
							sta_type: this.type,
							sta_cause: this.reason,
							sta_remarks: this.remarks,
							sta_transfer_date: this.transfer_date
						})
						.then(result =>{
							if(result.data.status == 200){
								alert("修改成功")
							}else{
								alert("修改失败")
							}
						})
					}
				}
			})
		</script>
	</body>

</html>